package nebenlaeufig;

import java.util.Queue;

public class NMain {

	/**
	 * @param args
	 * @throws Exception 
	 */
	public static void main(String[] args) {
		
		//booleanflags for some testing outprints
		boolean ausgabe=false,
				lockausgabe=false;
		args = new String[1];
		args[0] = "testsuite/crack/germany.xml";
		
		NGraph graph = null;
		try{
			graph = new NGraph(args);
		}catch(Exception e){
			System.out.println(-1);
			System.exit(-1);
			}
				
		NFirstPartition firstPartition = new NFirstPartition(graph,ausgabe);
		
		NLastPartition lastPartition = null;
		//could possibly happen, but shouldn't
		try {
			lastPartition = new NLastPartition(firstPartition.getMeshes(), ausgabe,lockausgabe);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		
		Queue<NMesh> ergMeshes = lastPartition.getFertig();
		
		System.out.println(ergMeshes.size());
		
		System.exit(ergMeshes.size());
	}
}